//
//  UpFlashPref.m
//  UpFlash
//
//  Created by Jan Staunton on 28/11/2010.
//  Copyright (c) 2010 Jan Staunton. All rights reserved.
//

#import "UpFlashPref.h"
#import "SparkleUpdaterForSelf.h"

@implementation UpFlashPref

- (void) mainViewDidLoad {	
	commonPrefs = [[CommonPrefs alloc] init];
	
	[theUseBetaButton setState:[commonPrefs getUseBeta]];
	[theFrequencyCombo selectItemWithObjectValue:[commonPrefs getFrequency]];
	
	[[SparkleUpdaterForSelf alloc] launchUpdater];
}

- (IBAction)checkboxClicked:(id)sender {
	[commonPrefs setUseBeta:[theUseBetaButton state]];
}

- (IBAction)frequencyComboChanged:(id)sender {
	[commonPrefs setFrequency:[theFrequencyCombo stringValue]];
}

- (IBAction)updateSelfButtonClicked:(id)sender {
	[[[SparkleUpdaterForSelf alloc] giveMeTheUpdaterBitch] checkForUpdates:self];
}

@end
